package com.lubase.metadata.invoke;

import com.lubase.core.extend.IInvokeMethod;
import com.lubase.metadata.service.MetadataProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@Component
public class getMetadataFromDatabase implements IInvokeMethod {

    @Autowired
    MetadataProcessService metadataProcessService;

    @Override
    public Object exe(HashMap<String, String> mapParam) throws Exception {
        String databaseId = checkAndGetParam("id", mapParam);
        return metadataProcessService.processMetadataByDatabaseId(databaseId);
    }

    @Override
    public String getDescription() {
        return "更新数据库元数据";
    }

    @Override
    public String getId() {
        return "1473068220347846656";
    }
}
